export const RET_CODE = Object.freeze({
    SUCCESS: 0,
    NOT_EFFECTIVE: 10,
    EXCEPTION_ERROR: 100,
    ARGUMENT_ERROR: 101,
    DATA_ERROR: 102,
    OPERATING_ERROR: 103,
    CONNECTION_ERROR: 105,
    RUNNING: 106,
    PERMISSION_ERROR: 108,
    AUTHENTICATION_ERROR: 109,
    UNAUTHORIZED: 401,
    SERVER_ERROR: 500,
    FORBIDDEN: 403,
    NOT_FOUND: 404,
})

export const API_ENDPOINTS = {
    chat: {
        base: '/chat',
        completion: '/completion',
    },
    llm: {
        base: '/llm',
        factories: '/factories',
        set_tenant_llm: '/tenant/set',
        tenant_llm_list: '/tenant/list',
    }
};

export const buildUrl = (module, endpoint) => {
    return `${API_ENDPOINTS[module].base}${endpoint}`;
};